﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Graduations 的摘要说明
/// </summary>
public class Graduations
{
	public Graduations()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    public void GetGraduations(string layname,int nGraduations,ref string strGraduations)
    {
              
        if (layname == "Drought")   
        {
            switch (nGraduations)
            {
                case 2:
                    strGraduations = "10,20,";
                    break;
                case 3:
                    strGraduations = "10,15,20,";
                    break;
                case 4:
                    strGraduations = "10,15,20,25,";
                    break;
                case 5:
                    strGraduations = "5,10,15,20,25,";
                    break;
                default:
                    strGraduations = "";
                    break;
            }
        }
        if (layname == "Disease")
        {
            switch (nGraduations)
            {
                case 2:
                    strGraduations = "0,20,";
                    break;
                case 3:
                    strGraduations = "0,20,40,";
                    break;
                case 4:
                    strGraduations = "0,35,40,45,";
                    break;
                case 5:
                    strGraduations = "0,25,40,45,50,";
                    break;
                default:
                    strGraduations = "";
                    break;
            }
        }
        if (layname == "DiseaseXJ") //病虫害分级
        {
            switch (nGraduations)
            {
                case 2:
                    strGraduations = "0.1,2,";
                    break;
                case 3:
                    strGraduations = "0.1,1.5,2.5,";
                    break;
                case 4:
                    strGraduations = "0.1,1.5,2.5,3.0,";
                    break;
                case 5:
                    strGraduations = "0.1,1.5,2.0,2.5,3.0,";
                    break;
                default:
                    strGraduations = "";
                    break;
            }
        }
    }
    public void GetLablesGraduations(string layname, int nGraduations, ref string strLabels)
    {
        
        if (layname == "Drought") 
        {
            switch (nGraduations)
            {
                case 2:
                    strLabels = "干旱,湿润,";
                    break;
                case 3:
                    strLabels = "干旱,轻旱,湿润,";
                    break;
                case 4:
                    strLabels = "干旱,轻旱,正常,湿润,";
                    break;
                case 5:
                    strLabels = "重旱,干旱,轻旱,正常,湿润,";
                    break;
                default:
                    strLabels = "";
                    break;
            }
        }
        if (layname == "Disease" || layname == "DiseaseXJ")
        {
            switch (nGraduations)
                {
                    case 2:
                        strLabels = "无病虫害,有病虫害,";
                        break;
                    case 3:
                        strLabels = "无病虫害,轻微病虫害,中等病虫害,";
                        break;
                    case 4:
                        strLabels = "无病虫害,轻微病虫害,中等病虫害,严重病虫害,";
                        break;
                    case 5:
                        strLabels = "无病虫害,轻微病虫害,中等病虫害,严重病虫害,极严重病虫害,";
                        break;
                    default:
                        strLabels = "";
                        break;
                }
        }
    }
    public void GetColorsGraduations(string layname, int nGraduations, ref string strColors)
    {
        
        if (layname == "品质遥感监测")
        {
            switch (nGraduations)
            {
                case 2:
                    strColors = ImsColor.lightgreen + "," + ImsColor.darkgreen;
                    break;
                case 3:
                    strColors = ImsColor.yellow + "," + ImsColor.lightgreen + "," + ImsColor.darkgreen;
                    break;
                case 4:
                    strColors = ImsColor.darkorange + "," + ImsColor.yellow + "," + ImsColor.lightgreen + "," + ImsColor.darkgreen;
                    break;
                case 5:
                    strColors = ImsColor.red + "," + ImsColor.darkorange + "," + ImsColor.yellow + "," + ImsColor.lightgreen + "," + ImsColor.darkgreen;
                    break;
                default:
                    strColors = "";
                    break;
            }
        }
        if (layname == "Drought")
        {
            switch (nGraduations)
            {
                case 2:
                    strColors = ImsColor.darkorange + "," + ImsColor.lightgreen;
                    break;
                case 3:
                    strColors = ImsColor.darkorange + "," + ImsColor.yellow + "," + ImsColor.lightgreen;
                    break;
                case 4:
                    strColors = ImsColor.darkorange + "," + ImsColor.yellow + "," + ImsColor.lightgreen + "," + ImsColor.darkgreen;
                    break;
                case 5:
                    strColors = ImsColor.red + "," + ImsColor.darkorange + "," + ImsColor.yellow + "," + ImsColor.lightgreen + "," + ImsColor.darkgreen;
                    break;
                default:
                    strColors = "";
                    break;
            }
        }
        if (layname == "Disease" || layname == "DiseaseXJ")
        {
            switch (nGraduations)
            {
                case 2:
                    strColors = ImsColor.lightgreen + "," + ImsColor.red;
                    break;
                case 3:
                    strColors = ImsColor.darkgreen + "," + ImsColor.blue + "," + ImsColor.yellow;
                    break;
                case 4:
                    strColors = ImsColor.darkgreen + "," + ImsColor.blue + "," + ImsColor.yellow + "," + ImsColor.red;
                    break;
                case 5:
                    strColors = ImsColor.darkgreen + "," + ImsColor.blue + "," + ImsColor.yellow + "," + ImsColor.darkorange + "," + ImsColor.red;
                    break;
                default:
                    strColors = "";
                    break;
            }
        }
    }
}
